/**
 * 
 */
package javas.system;

import java.lang.management.RuntimeMXBean;
import java.lang.management.ThreadMXBean;

import sun.management.ManagementFactory;

import com.sun.management.OperatingSystemMXBean;

public class TestManagementFactory {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
//		OperatingSystemMXBean test = ManagementFactory.getOperatingSystemMXBean();
//		double load = test.getSystemLoadAverage();
//		System.out.println(load);
//		System.out.println(test.getArch());
//		System.out.println(test.getAvailableProcessors());
//		System.out.println("---------------------------------");
		
		com.sun.management.OperatingSystemMXBean test2 = (OperatingSystemMXBean) sun.management.ManagementFactory.getOperatingSystemMXBean();
		System.out.println(test2.getProcessCpuTime());
		RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
		System.out.println(runtimeMXBean.getBootClassPath());
		
		ThreadMXBean tm=(ThreadMXBean)ManagementFactory.getThreadMXBean();  
        System.out.println("getThreadCount "+tm.getThreadCount());  
        System.out.println("getPeakThreadCount "+tm.getPeakThreadCount());  
        System.out.println("getCurrentThreadCpuTime "+tm.getCurrentThreadCpuTime());  
        System.out.println("getDaemonThreadCount "+tm.getDaemonThreadCount());  
        System.out.println("getCurrentThreadUserTime "+tm.getCurrentThreadUserTime());  		
	}
}
